package day05;

public class _Object01 {                                                 //文字版格斗游戏
    public static void main(String[] args) {
        GameBean r1=new GameBean("乔峰",100,'男');
        GameBean r2=new GameBean("鸠摩智",100,'男');
        r1.setFace(r1.getGender());
        r2.setFace(r2.getGender());
        r1.showInfo();
        r2.showInfo();
        while(r1.getBlood()>0||r2.getBlood()>0){
            r1.attack(r2);

            if(r2.getBlood()==0) {
                System.out.println(r1.getName()+"获胜!");
                break;
            }
            r2.attack(r1);
            if(r1.getBlood()==0) {
                System.out.println(r2.getName()+"获胜!");
                break;
            }
        }
    }
}
